//345.反转字符串中的元音字母
//https://leetcode.cn/problems/reverse-vowels-of-a-string/
class Solution {
public:
    string reverseVowels(string s) {
        bitset<128> hash;
        hash.set('a'); hash.set('A');
        hash.set('e'); hash.set('E');
        hash.set('i'); hash.set('I');
        hash.set('o'); hash.set('O');
        hash.set('u'); hash.set('U');
        
        int left = 0,right = s.size()-1;
        while(left < right)
        {
            while(left<right&&!hash.test(s[left])) ++left;
            while(left<right&&!hash.test(s[right])) --right;
            swap(s[left],s[right]);
            ++left;
            --right;
        }
        return s;
    }
};